# Convert wind farm count data to the same format as input file.
# Input file: tx_emp.txt
BEGIN {
  FS = ","
  OFS = ","
  while ((getline line < "/home/huizi/HOLA/research/green-jobs/data/tx_wind.csv") > 0) {
    split (line, x, ",")
    county = x[1]
    year = x[2]
    month = x[3]
    wcap[county,year,month] = x[4]
    aveDays[county,year,month] = x[5]
  }
}

{
  if ($1 SUBSEP $2 SUBSEP $3 in wcap) {
    print $0, wcap[$1,$2,$3], aveDays[$1,$2,$3]}
  else 
    print $0, 0, "NA"

}
